//
//  HBUserConfirmDistillParser.m
//  HuoBao
//
//  Created by chaiyanan on 15/12/21.
//  Copyright © 2015年 jinxin. All rights reserved.
//

#import "HBUserConfirmDistillParser.h"
#import "HBUserConfirmDistillInfo.h"

@implementation HBUserConfirmDistillParser

-(ParserResult*)parseResponseDictionary:(NSDictionary *)responseDictionary
{
    LLog(@"responseDictionary:%@",responseDictionary);
    ParserResult* result=[[ParserResult alloc]init];
    NSNumber* codeObject=[responseDictionary objectForKey:Key_Code];
    if (codeObject)
    {
        NSInteger code = [codeObject integerValue];
        result.code = code;
        result.message = [responseDictionary objectForKey:Key_Msg];
        if (code == 0)
        {
            NSDictionary *dataDict = [responseDictionary objectForKey:Key_Data];
            if (dataDict&&[dataDict isKindOfClass:[NSDictionary class]])
            {
                HBUserConfirmDistillInfo *info = [[HBUserConfirmDistillInfo alloc]init];
                info.distillStatus = [DataTypeTranslate numberToString:dataDict[Key_distillStatus]];
                info.arrivalHour = [DataTypeTranslate numberToString:dataDict[Key_arrivalHour]];
                info.distillMoney = [DataTypeTranslate numberToString:dataDict[Key_distillMoney]];
                info.distillTime = [DataTypeTranslate numberToString:dataDict[Key_distillTime]];
                info.interestDate = [DataTypeTranslate numberToString:dataDict[Key_interestDate]];
                info.bankCode = [DataTypeTranslate stringToString:dataDict[Key_bankCode]];
                info.bankName = [DataTypeTranslate stringToString:dataDict[Key_bankName]];
                info.bankCardShort = [DataTypeTranslate numberToString:dataDict[Key_bankCardShort]];
                
                result.result = info;
            }
            else
            {
                result.code=1;
                result.message=@"服务器数据异常";
            }
        }
        
    }
    else
    {
        result.code=1;
        result.message=@"服务器数据异常";
    }
    
    return result;
}


@end
